class BD_UseableObject extends Actor
	abstract;
	
var() bool bEnabled;

simulated function bool use(Pawn user){return false;}

auto state Active
{
	simulated event BeginState(Name PreviousStateName)
	{
		if(!bEnabled)//if its not enabled, move it immediatly to inactive and wait
		{
			goToState('inactive');
		}
	}

	simulated function bool use(Pawn user)
	{
		`log("Used");
		return true;
	}
	
	simulated event EndState(Name NextStateName)
	{
	}
}

state Inactive
{
	simulated event BeginState(Name PreviousStateName)
	{
	}
	
	simulated function bool Use(Pawn user){return false;}

	simulated event EndState(Name NextStateName)
	{
	}
}

function OnToggle(SeqAct_Toggle inAction)//controls the kismet Toggle node input
{
	if (inAction.InputLinks[0].bHasImpulse)
	{
		bEnabled = true;
	}
	else if (inAction.InputLinks[1].bHasImpulse)
	{
		bEnabled = false;
	}
	else if (inAction.InputLinks[2].bHasImpulse)
	{
		bEnabled = !bEnabled;
		
	}
	goToState('Active');
}
	
defaultproperties
{
	bEnabled = true
	bCollideActors = true
	bBlockActors = true
	bCollideWorld = true
	
	TickGroup=TG_DuringAsyncWork

	Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
		ModShadowFadeoutTime=0.25
		MinTimeBetweenFullUpdates=0.2
		AmbientGlow=(R=.01,G=.01,B=.01,A=1)
		AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
		bSynthesizeSHLight=TRUE
	End Object
	Components.Add(MyLightEnvironment)
	
	Begin Object Class=StaticMeshComponent Name=StaticMeshComp
		bOnlyOwnerSee=false
		HiddenGame=false
		CollideActors=true
		BlockActors=true
		BlockRigidBody=true
		BlockZeroExtent=true
		AlwaysLoadOnClient=true
		AlwaysLoadOnServer=true
		MaxDrawDistance=4000
		bAcceptsDynamicDecals=FALSE
		bAllowAmbientOcclusion=false
		LightEnvironment=MyLightEnvironment;
	End Object
	Components.Add(StaticMeshComp)
	//PickupMesh=EditorMesh;
	
	bCollideWhenPlacing=False
	bHiddenEd=false
	bStatic=false
	bNoDelete=true
	RemoteRole=ROLE_SimulatedProxy
	bAlwaysRelevant=true
	bIgnoreEncroachers=true
	bHidden=false
	NetUpdateFrequency=1.0
	
	//Components.Remove(Sprite)
}